<h4 class="manage-title">修改密码</h4>
<div class="profile_password">
    <form id="resetpassword" action="<!--{iCMS:router url='user'}-->" class="form-inline" method="post" target="iCMS_FRAME">
        <input name="action" type="hidden" value="profile" />
        <input name="pg" type="hidden" value="setpassword" />
        <div class="input-group">
            <div class="input-group-addon">
                <label for="oldPwd" class="control-label">现在的密码</label>
            </div>
            <input class="form-control" id="oldPwd" name="oldPwd" type="password">
        </div>
        <div class="clearfix mb10"></div>
        <div class="input-group">
            <div class="input-group-addon">
                <label for="newPwd1" class="control-label">新的密码</label>
            </div>
            <input class="form-control" id="newPwd1" name="newPwd1" class="gray_text r5" type="password">
        </div>
        <div class="clearfix mb10"></div>
        <div class="input-group">
            <div class="input-group-addon">
                <label for="newPwd2" class="control-label">确认新的密码</label>
            </div>
            <input class="form-control" id="newPwd2" name="newPwd2" type="password">
        </div>
        <div class="clearfix mb10"></div>
        <div class="input-group">
            <div class="input-group-addon">
                <label for="seccode" class="control-label">验证码</label>
            </div>
            <input type="text" maxlength="4" id="seccode" name="seccode" class="form-control">
            <div class="input-group-addon public_seccode_wrap">
              <!--{iCMS:public:seccode}-->
            </div>
        </div>
        <div class="clearfix mb10"></div>
        <div class="form-actions">
            <button class="btn btn-lg btn-block btn-primary" type="submit">
                <i class="fa fa-check"></i> 提 交
            </button>
        </div>
    </form>
</div>
<style>
.input-group-addon {padding: 5px 12px;width: 120px !important;}
.input-group-addon label{float: right;}
.input-group #seccode{width: 72px !important;}
.public_seccode_wrap{padding: 0px 4px;}
.seccode-img{margin-left: 4px;}
</style>
<script type="text/javascript">
$(function() {
    $("#resetpassword").submit(function() {
        var oldPwd = $("[name='oldPwd']");
        if (oldPwd.val() == "") {
            oldPwd.focus();
            iCMS.UI.alert("请填写现在的密码！");
            return false;
        }
        var newPwd1 = $("[name='newPwd1']");
        if (newPwd1.val() == "") {
            newPwd1.focus();
            iCMS.UI.alert("请填写新密码！");
            return false;
        }
        if (newPwd1.val().length < 6) {
            newPwd1.focus();
            iCMS.UI.alert("新密码太短啦，至少要6位哦");
            return false;
        }
        var newPwd2 = $("[name='newPwd2']");
        if (newPwd2.val() == "") {
            newPwd2.focus();
            iCMS.UI.alert("请确认新的密码！");
            return false;
        }
        if (newPwd1.val() != newPwd2.val()) {
            newPwd1.focus();
            iCMS.UI.alert("新的密码与确认密码不一致！");
            return false;
        }
        var seccode = $("[name='seccode']");
        if (seccode.val() == "") {
            seccode.focus();
            iCMS.UI.alert("请输入验证码！");
            return false;
        }
    })
})
</script>
